<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
    <script src="__PUBLIC__/layui/layui.js" charset="utf-8"></script>
    <style type="text/css">
        .select {
            display: inline;
        }
    </style>
</head>
<body style="background-color: #fff;">

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;text-align: center;font-family: kaiti;">
    <legend>修改院系信息</legend>
</fieldset>

<div style="width: 500px; margin: 15px auto;padding: 15px;border: 2px solid #666;background-color: #fff;">
    <form  action="__CONTROLLER__/update" method="post">
        <div class="layui-form-item" style="width: 400px;">
            <label class="layui-form-label">院系编号</label>
            <input type="hidden" name="college_id"  value={$college_id}>
            <div class="layui-input-block" style="padding-top: 10px">
                {$college_id}
            </div>
        </div>

        <div class="layui-form-item" style="width: 400px;">
            <label class="layui-form-label">院系名称</label>
            <div class="layui-input-block">
                <input type="text" name="college_name" class="layui-input" value="{$college_name}" id="college_name">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="submit" value="确定" class="layui-btn" id="sure">
                <!-- <button type="reset" class="layui-btn" >重置</button> -->
                <a href="http://www.sinon.com/index.php/Admin/college/index" class="layui-btn">取消</a>
            </div>
        </div>
    </form>
</div>
</body>
</html>

<script>
    //设置院系
    var count = $("#college option").length;
    var text = $("#hidden_value").val();
    for (var i = 0; i < count; i++) {
        if ($("#college ").get(0).options[i].text == text) {
            $("#college ").get(0).options[i].selected = true;
            break;
        }
    }
    //设置职称
    var count_title = $("#title option").length;
    var title_text = $("#hidden_title_value").val();
    for (var i = 0; i < count_title; i++) {
        if ($("#title ").get(0).options[i].text == title_text) {
            $("#title ").get(0).options[i].selected = true;
            break;
        }
    }

    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');
    });

    $('#sure').on('click', function(){
        var cna = $('#college_name').val();

        if(cna==''){
            layer.msg('请填写完整数据');
            return false;
        }
    }); 

    $(document).ready(function(){
        $('input').attr('autocomplete', 'off'); 
    })
</script>

</body>
</html>